package com.learn.xueer.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.learn.xueer.R
import com.learn.xueer.data.model.bean.TextBookUnitResponse

class UnitPopAdapter(data:ArrayList<TextBookUnitResponse>):BaseQuickAdapter<TextBookUnitResponse,BaseViewHolder>(
    R.layout.item_unit_pop,data) {
    override fun convert(holder: BaseViewHolder, item: TextBookUnitResponse) {
        holder.setText(R.id.unitName,item.name)
        val position = holder.adapterPosition
        if (position == data.size-1){
            holder.setVisible(R.id.line,false)
        }else{
            holder.setVisible(R.id.line,true)
        }
    }
}